package com.gupaoedu.vip.netty.io.nio.tomcat.http;

/**
 * @program:gupaoedu-vip-netty-io
 * @description:模拟J2EE标准的servlet
 * @author:Gongchao
 * @date:2020-04-28
 **/
public abstract class GPServlet {

    public abstract void doGet(GPRequest request,GPResponse response)throws Exception;

    public abstract void doPost(GPRequest request,GPResponse response)throws Exception;

    public void service(GPRequest request,GPResponse response) throws Exception{
        if("GET".equalsIgnoreCase(request.getMethod())) {
            doGet(request,response);
        }else {
            doPost(request,response);
        }
    }
}
